//
// Created by yan on 6/14/17.
//

#ifndef YUNBADEMO_YUNBA_SERVER_H
#define YUNBADEMO_YUNBA_SERVER_H

#include "libyunba/yunba.h"
#include <iostream>

using namespace std;

class yunba_server {
public:
    yunba_server(string keystring );
    int connect();
    int setup(void);
    int pub(string data);
    void setTopic(string n){
        topic = n;
    }
private:
    string appkey ;
    string topic = "test" ;
    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
    char *deviceid = NULL;
    REG_info my_reg_info;
    MQTTClient client;
    MQTTClient_messageArrived * callbackmessage;
    MQTTClient_extendedCmdArrive * callbackextened;
};


#endif //YUNBADEMO_YUNBA_SERVER_H
